package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.junsi.bean.Jurisdiction;
import com.junsi.mapper.JurisdictionMapper;
import com.junsi.service.JurisdictionSerivce;

/**
 * 权限Serivce接口实现类
 * @author wkp
 *
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class JurisdictionSerivceImpl implements JurisdictionSerivce {
	
	@Autowired
	private JurisdictionMapper jurisdictionMapper;
	
	@Override
	public Jurisdiction findById(Integer id) {
		
		return jurisdictionMapper.findById(id);
	}

	@Override
	public List<Jurisdiction> findByAll() {
		
		return jurisdictionMapper.findByAll();
	}

	@Override
	public boolean save(Jurisdiction jurisdiction) {
		int i = jurisdictionMapper.save(jurisdiction);
		if(i == 1){
			return true;
		}
		return false;
	}

	@Override
	public boolean update(Jurisdiction jurisdiction) {
		int i = jurisdictionMapper.update(jurisdiction);
		if(i == 1){
			return true;
		}
		return false;
	}

	@Override
	public boolean delete(Integer id) {
		int i = jurisdictionMapper.delete(id);
		if(i == 1){
			return true;
		}
		return false;
	}

	@Override
	public Jurisdiction findByStaff(Integer staffId) {
		
		return jurisdictionMapper.findByStaff(staffId);
	}

}
